package com.ehotting.mqbd.api.converter;

import com.ehotting.mqbd.api.enums.ProtocolTypeEnum;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

@Component
@ConfigurationPropertiesBinding
public class ProtocolTypeConverter implements Converter<String, ProtocolTypeEnum> {
    @Override
    public ProtocolTypeEnum convert(String source) {
        return  ProtocolTypeEnum.fromCode(source);
    }
}
